<?php

namespace app\zmt\validate;

use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'name' => 'require|max:25',
        'image' => 'require',
        'mobile' => 'require|mobile',
    ];

    protected $message = [
        'name.require' => '用户名不能为空',
        'name.max' => '用户名不能超过25个字符',
        'image.require' => '图片不能为空',
        'mobile.require' => '手机号不能为空',
        'mobile.mobile' => '手机号格式不正确',
    ];
    protected $scene = [
        'addpost' => ['mobile', 'image', 'name'],
        'editpost' => ['mobile', 'image', 'name'],
    ];
}
